package com.fastCms.customer.frame.controller;


import com.fastCms.business.frame.pojo.PageParam;
import com.fastCms.business.frame.pojo.po.NewsQueryPO;
import com.fastCms.business.frame.pojo.vo.NewsVO;
import com.fastCms.business.frame.response.ApiResponse;
import com.fastCms.business.frame.response.ResponseUtil;
import com.fastCms.business.frame.service.NewsService;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 新闻资讯 前端控制器
 * </p>
 *
 * @author quan
 * @since 2024-05-23
 */
@Api(value = "ApiNewsController", tags = "C端-新闻咨询")
@RestController
@RequestMapping("api/news")
public class ApiNewsController {
    @Resource
    private NewsService newsService;

    @PostMapping("/showPage")
    @ApiOperation(value = "分页", notes = "根据业务列表查询")
    public ApiResponse<PageInfo<NewsVO>> showPage(@RequestBody PageParam<NewsQueryPO> param) {
        PageInfo<NewsVO> result = newsService.showPage(param);
        return ResponseUtil.success(result);
    }
}

